using System.Collections.Generic;
using UnityEngine;

public class PageScroll : MonoBehaviour
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    List<Transform> children=new List<Transform>();
    int index=0;
    void Start()
    {
        for(int i=0;i<transform.childCount;i++)
        {
            children.Add(transform.GetChild(i));
        }
    }
    public void Forward()
    {
        print("www");
        children[index].gameObject.SetActive(false);
        index++;
        children[index].gameObject.SetActive(true);
    }
    public void Backward()
    {
        children[index].gameObject.SetActive(false);
        index--;
        children[index].gameObject.SetActive(true);
    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
